﻿CREATE TABLE [dbo].[BookSchedule]
(
	[Id] BIGINT NOT NULL PRIMARY KEY IDENTITY, 
	[ScheduleId] NVARCHAR(50) NULL, 
    [DeptId] NVARCHAR(50) NULL, 
    [DeptName] NVARCHAR(50) NULL,
	[DoctorId] NVARCHAR(50) NULL, 
	[DoctorName] NVARCHAR(50) NULL, 
	[SubjectId] NVARCHAR(50) NULL, 
	[SubjectName] NVARCHAR(50) NULL, 
	[BookCount] NVARCHAR(6) NULL, 
	[BookLimit] NVARCHAR(6) NULL, 
	[RegType] NVARCHAR(50) NULL, 
	[RegAmt] NVARCHAR(50) NULL, 
	[StartTime] NVARCHAR(30) NULL, 
	[EndTime] NVARCHAR(30) NULL, 
	[BookStartTime] NVARCHAR(30) NULL, 
	[BookEndTime] NVARCHAR(30) NULL, 
	[RecStatus] int not null,
	[RecCreateDt] DateTime NOT NULL,
	[RecUpdateDt] DATETIME NULL
)

GO
EXEC sp_addextendedproperty @name = N'MS_Description',
    @value = N'记录状态 1-可用 0-不可用',
    @level0type = N'SCHEMA',
    @level0name = N'dbo',
    @level1type = N'TABLE',
    @level1name = N'BookSchedule',
    @level2type = N'COLUMN',
    @level2name = N'RecStatus'
GO
EXEC sp_addextendedproperty @name = N'MS_Description',
    @value = N'班表ID',
    @level0type = N'SCHEMA',
    @level0name = N'dbo',
    @level1type = N'TABLE',
    @level1name = N'BookSchedule',
    @level2type = N'COLUMN',
    @level2name = N'ScheduleId'
GO
EXEC sp_addextendedproperty @name = N'MS_Description',
    @value = N'科室ID',
    @level0type = N'SCHEMA',
    @level0name = N'dbo',
    @level1type = N'TABLE',
    @level1name = N'BookSchedule',
    @level2type = N'COLUMN',
    @level2name = N'DeptId'
GO
EXEC sp_addextendedproperty @name = N'MS_Description',
    @value = N'科室名称',
    @level0type = N'SCHEMA',
    @level0name = N'dbo',
    @level1type = N'TABLE',
    @level1name = N'BookSchedule',
    @level2type = N'COLUMN',
    @level2name = N'DeptName'
GO
EXEC sp_addextendedproperty @name = N'MS_Description',
    @value = N'医生ID',
    @level0type = N'SCHEMA',
    @level0name = N'dbo',
    @level1type = N'TABLE',
    @level1name = N'BookSchedule',
    @level2type = N'COLUMN',
    @level2name = N'DoctorId'
GO
EXEC sp_addextendedproperty @name = N'MS_Description',
    @value = N'医生名称',
    @level0type = N'SCHEMA',
    @level0name = N'dbo',
    @level1type = N'TABLE',
    @level1name = N'BookSchedule',
    @level2type = N'COLUMN',
    @level2name = N'DoctorName'
GO
EXEC sp_addextendedproperty @name = N'MS_Description',
    @value = N'挂号科目ID',
    @level0type = N'SCHEMA',
    @level0name = N'dbo',
    @level1type = N'TABLE',
    @level1name = N'BookSchedule',
    @level2type = N'COLUMN',
    @level2name = N'SubjectId'
GO
EXEC sp_addextendedproperty @name = N'MS_Description',
    @value = N'挂号科目',
    @level0type = N'SCHEMA',
    @level0name = N'dbo',
    @level1type = N'TABLE',
    @level1name = N'BookSchedule',
    @level2type = N'COLUMN',
    @level2name = N'SubjectName'
GO
EXEC sp_addextendedproperty @name = N'MS_Description',
    @value = N'预约数',
    @level0type = N'SCHEMA',
    @level0name = N'dbo',
    @level1type = N'TABLE',
    @level1name = N'BookSchedule',
    @level2type = N'COLUMN',
    @level2name = N'BookCount'
GO
EXEC sp_addextendedproperty @name = N'MS_Description',
    @value = N'预约限号数',
    @level0type = N'SCHEMA',
    @level0name = N'dbo',
    @level1type = N'TABLE',
    @level1name = N'BookSchedule',
    @level2type = N'COLUMN',
    @level2name = N'BookLimit'
GO
EXEC sp_addextendedproperty @name = N'MS_Description',
    @value = N'号类',
    @level0type = N'SCHEMA',
    @level0name = N'dbo',
    @level1type = N'TABLE',
    @level1name = N'BookSchedule',
    @level2type = N'COLUMN',
    @level2name = N'RegType'
GO
EXEC sp_addextendedproperty @name = N'MS_Description',
    @value = N'挂号费',
    @level0type = N'SCHEMA',
    @level0name = N'dbo',
    @level1type = N'TABLE',
    @level1name = N'BookSchedule',
    @level2type = N'COLUMN',
    @level2name = N'RegAmt'
GO
EXEC sp_addextendedproperty @name = N'MS_Description',
    @value = N'班段开始时间',
    @level0type = N'SCHEMA',
    @level0name = N'dbo',
    @level1type = N'TABLE',
    @level1name = N'BookSchedule',
    @level2type = N'COLUMN',
    @level2name = N'StartTime'
GO
EXEC sp_addextendedproperty @name = N'MS_Description',
    @value = N'班段结束时间',
    @level0type = N'SCHEMA',
    @level0name = N'dbo',
    @level1type = N'TABLE',
    @level1name = N'BookSchedule',
    @level2type = N'COLUMN',
    @level2name = N'EndTime'
GO
EXEC sp_addextendedproperty @name = N'MS_Description',
    @value = N'预约开始时间',
    @level0type = N'SCHEMA',
    @level0name = N'dbo',
    @level1type = N'TABLE',
    @level1name = N'BookSchedule',
    @level2type = N'COLUMN',
    @level2name = N'BookStartTime'
GO
EXEC sp_addextendedproperty @name = N'MS_Description',
    @value = N'预约结束时间',
    @level0type = N'SCHEMA',
    @level0name = N'dbo',
    @level1type = N'TABLE',
    @level1name = N'BookSchedule',
    @level2type = N'COLUMN',
    @level2name = N'BookEndTime'
GO
EXEC sp_addextendedproperty @name = N'MS_Description',
    @value = N'记录创建时间',
    @level0type = N'SCHEMA',
    @level0name = N'dbo',
    @level1type = N'TABLE',
    @level1name = N'BookSchedule',
    @level2type = N'COLUMN',
    @level2name = N'RecCreateDt'
GO
EXEC sp_addextendedproperty @name = N'MS_Description',
    @value = N'记录更新时间',
    @level0type = N'SCHEMA',
    @level0name = N'dbo',
    @level1type = N'TABLE',
    @level1name = N'BookSchedule',
    @level2type = N'COLUMN',
    @level2name = N'RecUpdateDt'